# -*- coding:utf-8 -*-

def trim(s):
    if len(s) !=0:
        while s[0]=='':
            if s =='':
                break
            s = s[1:]
        while s[-1]=='':
            if s=='':
                break
            s = s[:-1]
    if s=='':
        return ''
    else:
        return s